package com.weharvest.edu.utlis;

import net.minidev.json.JSONObject;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class ResponseUtil  {
    /**
     * 向浏览器输出消息
     *
     * @param
     * @param response
     */

    public static void wirteResponseMsg(JSONObject jsonObject , HttpServletResponse response) {
        response.setContentType("text/html;charset=UTF-8;");
        PrintWriter writer=null;
        try {
            writer = response.getWriter();
            writer.append(jsonObject.toString());
            writer.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
